﻿namespace NHibernate.Proxy.Web
{
	using System;
	using Cfg;
	using Tests;

	public class Global : System.Web.HttpApplication
	{

		protected void Application_Start(object sender, EventArgs e)
		{
			log4net.Config.XmlConfigurator.Configure(); 
			Configuration cfg = new Configuration();
			cfg.AddAssembly( typeof( Person ).Assembly ); 
			ISessionFactory factory = cfg.BuildSessionFactory();
			using(ISession session = factory.OpenSession())
			{
				PhoneNumber pn = session.Load<PhoneNumber>(1);
				Person p = pn.Person;
			}
		}

		protected void Session_Start(object sender, EventArgs e)
		{

		}

		protected void Application_BeginRequest(object sender, EventArgs e)
		{

		}

		protected void Application_AuthenticateRequest(object sender, EventArgs e)
		{

		}

		protected void Application_Error(object sender, EventArgs e)
		{

		}

		protected void Session_End(object sender, EventArgs e)
		{

		}

		protected void Application_End(object sender, EventArgs e)
		{

		}
	}
}